package org.example.blogpojo.blog.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Menu {
    private Long id;
    private String name;
    private String component;
    private String url;
    private String icon;
    private Integer index;
    private Long parentId;

    //父菜单对象
    private Menu parentMenu;

    //子菜单对象
    //父菜单树最后一级没有数据就不显示
    @JsonInclude (JsonInclude.Include.NON_EMPTY)
    List<Menu> children = new ArrayList<Menu>();
}
